package com.mogician.rabbitmq_demo.util;

import com.rabbitmq.client.ConnectionFactory;

public class ConnectionUtil
{
    public static String MQ_EXCHANGE_NAME = "demo";
    public static String MQ_ROUTING_KEY = "";

    /**
     * 连接设置
     */
    public static ConnectionFactory setUpConnectionFactory() {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("10.0.2.2");//主机地址
        factory.setPort(5672);// 端口号:5672
        factory.setUsername("guest");// 用户名
        factory.setPassword("guest");// 密码
        factory.setAutomaticRecoveryEnabled(true);// 设置连接恢复
        return factory;
    }

}
